import { Typography } from "antd"

import { FormatMessageProps } from "@/locales"

export const columnsBankCard = (formatMessage: FormatMessageProps) => [
	{
		dataIndex: "bindingTime",
		title: formatMessage({ id: "member.bank_card.binding_time" }),
		render: (value: any, record: any) => <p>{record.bindStatus}</p>,
		width: 150,
		align: "center",
		key: "binding_time"
	},
	{
		dataIndex: "bankName",
		title: formatMessage({ id: "member.bank_card.bank_name" }),
		render: (value: any, record: any) => <p>{record.bankName}</p>,
		width: 150,
		align: "center",
		key: "bank_name"
	},
	{
		dataIndex: "cardholderName",
		title: formatMessage({ id: "member.bank_card.cardholders_name" }),
		render: (value: any, record: any) => <p>{record.cnName}</p>,
		width: 150,
		align: "center",
		key: "cardholder_Name"
	},
	{
		dataIndex: "cardNumber",
		title: formatMessage({ id: "member.bank_card.card_number" }),
		render: (value: any, record: any) => <p>{record.cardNumber}</p>,
		width: 150,
		align: "center",
		key: "card_number"
	},
	{
		dataIndex: "branchAddress",
		title: formatMessage({ id: "member.bank_card.branch_address" }),
		render: (value: any, record: any) => <p>{record.bankAddress}</p>,
		width: 150,
		align: "center",
		key: "branch_address"
	},
	{
		dataIndex: "bankCardStatus",
		title: formatMessage({ id: "member.bank_card.bank_card_status" }),
		render: (value: any, record: any) => <p>{record.blackStatus}</p>,
		width: 150,
		align: "center",
		key: "bank_card_status"
	},
	{
		dataIndex: "bankCardRiskControlLevels",
		title: formatMessage({ id: "member.bank_card.bank_card_risk_control_levels" }),
		render: (value: any, record: any) => <p>{record.windControlName}</p>,
		width: 150,
		align: "center",
		key: "bank_card_risk_control_levels"
	}
]
export const columnsVirtualCurrency = (formatMessage: FormatMessageProps) => [
	{
		dataIndex: "bindingTime",
		title: formatMessage({ id: "member.virtual_currency_account_information.binding_time" }),
		render: (value: any, record: any) => <p>{record.bindStatus}</p>,
		width: 150,
		align: "center",
		key: "binding_time"
	},

	{
		dataIndex: "virtualCurrencyAccountAddress",
		title: formatMessage({ id: "member.virtual_currency_account_information.virtual_currency_account_address" }),
		render: (value: any, record: any) => <p>{record.clubId}</p>,
		width: 150,
		align: "center",
		key: "virtual_currency_account_address"
	},
	{
		dataIndex: "TypeOfVirtualCurrency",
		title: formatMessage({ id: "member.virtual_currency_account_information.types_of_virtual_currency" }),
		render: (value: any, record: any) => <p>{record.clubId}</p>,
		width: 150,
		align: "center",
		key: "Type_of_virtual_currency"
	},
	{
		dataIndex: "virtualCurrencyProtocol",
		title: formatMessage({ id: "member.virtual_currency_account_information.virtual_currency_protocol" }),
		render: (value: any, record: any) => <p>{record.virtualProtocol}</p>,
		width: 150,
		align: "center",
		key: "virtual_currency_protocol"
	},
	{
		dataIndex: "virtualCurrencyAccountStatus",
		title: formatMessage({ id: "member.virtual_currency_account_information.virtual_currency_account_status" }),
		render: (value: any, record: any) => <p>{record.clubId}</p>,
		width: 150,
		align: "center",
		key: "virtual_currency_account_status"
	},

	{
		dataIndex: "virtualCurrencyAccountRiskControLevel",
		title: formatMessage({ id: "member.virtual_currency_account_information.virtual_currency_account_risk_control_level" }),
		render: (value: any, record: any) => <p>{record.clubId}</p>,
		width: 150,
		align: "center",
		key: "virtual_currency_account_risk_control_level"
	}
]
export const columnsWhiteHorse = (formatMessage: FormatMessageProps, optionsBindStatus: any) => [
	{
		dataIndex: "createdAt",
		title: formatMessage({ id: "member.white_horse.binding_time" }),
		render: (value: any, record: any) => <p>{record.createdAt || "-"}</p>,
		width: 150,
		align: "center",
		key: "createdAt"
	},
	{
		dataIndex: "bmhName",
		title: formatMessage({ id: "member.white_horse.club_account" }),
		render: (value: any, record: any) => <p>{record.bmhName || "-"}</p>,
		width: 150,
		align: "center",
		key: "bmhName"
	},
	{
		dataIndex: "bindStatus",
		title: formatMessage({ id: "member.white_horse.status" }),
		render: (value: any, record: any) => {
			const result =
				optionsBindStatus.filter((item: { value: string; label: string }) => item.value == record.bindStatus)[0]?.label ??
				record.bindStatus

			return record.bindStatus ? (
				<Typography.Text type={record.bindStatus === 0 ? "danger" : "success"}>{result}</Typography.Text>
			) : (
				<p>-</p>
			)
		},
		width: 150,
		align: "center",
		key: "bindStatus"
	},
	{
		dataIndex: "windControlName",
		title: formatMessage({ id: "member.white_horse.risk_control_level" }),
		render: (value: any, record: any) => <p>{record.windControlName || "-"}</p>,
		width: 150,
		align: "center",
		key: "windControlName"
	}
]
